<!-- angular通过ng-modal添加模态框时，不需要外层的div，只需从modal-content开始即可 -->
<style>

</style>
<div class="modal-content">
    <div class="modal-header">
        <h3 class="modal-title">{{info.radioStatus == "true" ? "新建工程" : "已有工程"}}</h3>
    </div>
    <form class="modal-body form-horizontal">
        <div class="form-group">
            <label class="col-sm-2 control-label"></label>
            <div class="col-sm-5 radio">
                <label>
                    <input type="radio" name="optionsRadios" value="true" ng-model="info.radioStatus"
                           ng-change="radioChange()" checked>
                    新建工程
                </label>
            </div>
            <div class="col-sm-5 radio">
                <label>
                    <input type="radio" name="optionsRadios" value="false" ng-model="info.radioStatus"
                           ng-change="radioChange()">
                    已有工程
                </label>
            </div>
        </div>
        <div class="line-lg pull-in" style="margin-top: 8px;margin-bottom: 8px;"></div>
        <!-- 新建工程 -->
        <div class="form-group" ng-if="info.radioStatus == 'true'">
            <label class="col-sm-2 control-label">选择工程：</label>
            <div class="col-sm-10">
                <i class="mm-loading-icon fa fa-spinner fa-spin fa-4x fa-fw" style="font-size: 33px; color: rgb(158, 149, 149);" ng-if="!hideIcon"></i>
                <select class="form-control mm-loading" ng-model="info.trunkName" ng-change="selectChange()">
                    <option value="">请选择工程</option>
                    <div ng-repeat="i in info.projectList">
                        <option ng-show="i.project_name!=s.project_name"
                                value="{{s.project_name}}"
                                ng-repeat="s in info.showTrunkList">
                                {{s.project_name}}
                        </option>
                    </div>
                </select>
            </div>
        </div>
        <div class="line-lg pull-in" ng-if="info.radioStatus == 'true'"></div>
        <div class="form-group" ng-if="info.radioStatus == 'true'">
            <label class="col-sm-2 control-label">选择来源：</label>
            <div class="col-sm-10">
                <select class="form-control">
                    <option value="">请选择来源</option>
                    <option value="{{i.name}}" ng-repeat="i in info.projectInfo.svn_list">{{i.name}}</option>
                </select>
            </div>
        </div>
        <div class="line-lg pull-in" ng-if="info.radioStatus == 'true'"></div>
        <div class="form-group" ng-if="info.radioStatus == 'true'">
            <label class="col-sm-2 control-label">分支版本：</label>
            <div class="col-sm-10">
                <input type="text" class="form-control" placeholder="请输入分支版本号" ng-model="info.projectInfo.branch_num"
                       ng-change="updateBranch_num()">
                <div nf-show="info.msg != ''" style="color: #f05050;">{{info.msg}}</div>
            </div>
        </div>
        <div class="line-lg pull-in" ng-if="info.radioStatus == 'true'"></div>
        <div class="form-group" ng-if="info.radioStatus == 'true'">
            <label class="col-sm-2 control-label">目标工程：</label>
            <div class="col-sm-10">
                <label class="control-label" ng-hide="info.projectInfo.length ==''">{{info.projectInfo.trunk_name}}-{{info.projectInfo.branch_num}}.{{info.planInfo.plan_code}}</label>
                <label class="control-label" ng-show="info.projectInfo.length ==''">0.0</label>
            </div>
        </div>
        <!-- end 新建工程 -->
        <!-- 已有工程 -->
        <div class="form-group" ng-if="info.radioStatus == 'false'">
            <label class="col-sm-2 control-label">主干：</label>
            <div class="col-sm-10 form-select">
                <i class="mm-loading-icon fa fa-spinner fa-spin fa-4x fa-fw" style="font-size: 33px; color: rgb(158, 149, 149);"></i>
                <ui-select class="mm-loading" ng-model="info.trunkInfo" ng-change="getBeetleProjectListByTrunk();" style="display: none;">
                    <ui-select-match placeholder="选择主干工程">{{$select.selected.projectName}}</ui-select-match>
                    <ui-select-choices repeat="project in info.trunkList | filter: $select.search|limitTo:15">
                        <span ng-bind-html="project.projectName | highlight: $select.search"></span>
                    </ui-select-choices>
                </ui-select>
                <label class="control-label" style="color: #f05050;"><i class="fa fa-exclamation-circle"></i>不能选择主干工程进行添加,如果要使用主干,需要选择"新建工程",然后从主干上创建一个新分支</label>
            </div>
        </div>
        <div class="line-lg pull-in" ng-if="info.radioStatus == 'false'"></div>
        <div class="form-group" ng-if="info.radioStatus == 'false'">
            <label class="col-sm-2 control-label">分支：</label>
            <div class="col-sm-10">
                <ui-select ng-model="info.projectInfo">
                    <ui-select-match placeholder="选择分支工程">{{$select.selected.projectName}}</ui-select-match>
                    <ui-select-choices repeat="project in info.projectList | filter: $select.search|limitTo:15">
                        <span ng-bind-html="project.projectName | highlight: $select.search"></span>
                    </ui-select-choices>
                </ui-select>
            </div>
        </div>
        <!-- end 已有工程 -->
    </form>
    <div class="modal-footer">
        <button type="button" class="btn btn-primary" ng-click="saveClick()" ng-disabled="(info.radioStatus == 'true' && info.msg!='')
        || (info.radioStatus == 'false'&&(info.projectInfo.projectName == info.trunkInfo.projectName ||info.projectInfo.projectName == undefined||info.trunkInfo.projectName == undefined))">
            确定
        </button>
        <button type="button" class="btn btn-default" data-dismiss="modal" ng-click="cancelClick()">取消</button>
    </div>
</div>
